.student-ai-assistant {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: white;
}

.assistant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom: 1px solid #e8e8e8;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assistant-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.service-status {
  font-size: 12px;
  opacity: 0.9;
}

.status-checking {
  color: #ffd700;
}

.status-online {
  color: #4ade80;
}

.status-offline {
  color: #f87171;
}

.assistant-header .close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.assistant-header .close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.assistant-context {
  padding: 16px 24px;
  background: #f8f9fa;
  border-bottom: 1px solid #e8e8e8;
  max-height: 200px;
  overflow-y: auto;
}

.assistant-context h4 {
  margin: 0 0 12px 0;
  color: #333;
  font-size: 14px;
  font-weight: 600;
}

.assistant-context pre {
  margin: 0;
  font-size: 12px;
  color: #666;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
  background: white;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #e8e8e8;
}

.quick-questions {
  padding: 16px 24px;
  background: #f0f2f5;
  border-bottom: 1px solid #e8e8e8;
}

.quick-questions h4 {
  margin: 0 0 12px 0;
  color: #333;
  font-size: 14px;
  font-weight: 600;
}

.question-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.question-tag {
  background: white;
  border: 1px solid #d9d9d9;
  color: #333;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.question-tag:hover {
  background: #1890ff;
  color: white;
  border-color: #1890ff;
  transform: translateY(-1px);
}

.assistant-messages {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fafafa;
}

.message {
  display: flex;
  gap: 12px;
  animation: fadeInUp 0.3s ease;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.message.ai .message-avatar {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.message-content {
  max-width: 70%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.message.user .message-content {
  align-items: flex-end;
}

.message-text {
  background: rgba(255, 255, 255, 0.95);
  padding: 14px 18px;
  border-radius: 20px;
  color: #1a202c;
  line-height: 1.7;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.2px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.message.user .message-text {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.message-time {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.6);
  margin: 0 8px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: white;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #667eea;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

.assistant-input {
  padding: 20px 24px;
  background: white;
  border-top: 1px solid #e8e8e8;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.assistant-input textarea {
  flex: 1;
  background: #f5f5f5;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  color: #333;
  font-family: inherit;
  transition: all 0.2s ease;
}

.assistant-input textarea:focus {
  background: white;
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.assistant-input textarea::placeholder {
  color: #999;
}

.send-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.send-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 滚动条样式 */
.assistant-messages::-webkit-scrollbar {
  width: 6px;
}

.assistant-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.assistant-messages::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.assistant-messages::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 动画 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .assistant-header {
    padding: 16px 20px;
  }
  
  .assistant-context {
    padding: 12px 20px;
  }
  
  .quick-questions {
    padding: 12px 20px;
  }
  
  .assistant-messages {
    padding: 16px 20px;
  }
  
  .assistant-input {
    padding: 16px 20px;
    flex-direction: column;
    gap: 12px;
  }
  
  .send-btn {
    align-self: flex-end;
  }
  
  .message-content {
    max-width: 85%;
  }
}
